# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>

pkgname=sequoia-keyring-linter
pkgver=1.0.0
pkgrel=1
pkgdesc='OpenPGP certificate linter'
url='https://sequoia-pgp.org/'
arch=('loong64' 'x86_64')
license=('GPL2')
groups=('sequoia')
depends=('glibc' 'nettle' 'libhogweed.so' 'libnettle.so' 'gcc-libs' 'gmp')
makedepends=('git' 'cargo' 'llvm' 'clang')
source=(https://gitlab.com/sequoia-pgp/keyring-linter/-/archive/v${pkgver}/keyring-linter-v${pkgver}.tar.gz)
sha512sums=('64623a175d84d124e0943f74d06b28d9f0182d14cb1f28bd52511816d86ef280854591115dd8e94abe4d01072b8e2b363015aa8fba5c1dccc086c0dfd284c6fe')
b2sums=('0f495bfa8772274a0c39d0b8fe000bd08223fea7434ce4edfaed73dbf3c38209cab457c501f14f4e538d09b8f9ad4a1156ea1b7c95c74dec1b63902455862417')

prepare() {
  cd keyring-linter-v${pkgver}
  sed 's/debug/release/g' -i -- Makefile
}

build() {
  cd keyring-linter-v${pkgver}
  cargo build --release
  make
}

check() {
  cd keyring-linter-v${pkgver}
  cargo test --release
}

package() {
  cd keyring-linter-v${pkgver}
  install -Dm 755 target/release/sq-keyring-linter -t "${pkgdir}/usr/bin"
  install -Dm 644 sq-keyring-linter.1 -t "${pkgdir}/usr/share/man/man1"
  install -Dm 644 README.md -t "${pkgdir}/usr/share/doc/${pkgname}"
}

# vim: ts=2 sw=2 et:
